//
//  LTView.m
//  UI03_CustomView
//
//  Created by Scott on 16/5/5.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "LTView.h"

@implementation LTView

#pragma mark - Creating and Init
+ (instancetype)ltViewWithFrame:(CGRect)frame title:(NSString *)title placeHolder:(NSString *)placeHolder {
    
    LTView *view = [[LTView alloc] initWithFrame:frame];
    
    // 创建子控件.
    view.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width / 3, frame.size.height)];
    [view addSubview:view.label];
    [view.label release];
    
    view.textField = [[UITextField alloc] initWithFrame:CGRectMake(frame.size.width / 3, 0, frame.size.width * 2 / 3, frame.size.height)];
    [view addSubview:view.textField];
    [view.textField release];
    
    // 配置子控件.
    [view configWithTitle:title placeHolder:placeHolder];
    
    
    return [view autorelease];
}

#pragma mark - config
- (void)configWithTitle:(NSString *)title placeHolder:(NSString *)placeHolder {
    
    self.label.text = title;
    self.textField.placeholder = placeHolder;
    self.textField.borderStyle = 3;
    
}




@end
